<?php
include 'header1.php';
?>
<?php
				$id = $this->session->userdata('id_user');
				$data = $this->cart_model->cart($id);
				$rss = new DOMDocument();
				$rss->load('http://localhost/ebisnis-kita/rsslagi.php');

				$feed = array();
				foreach ($rss->getElementsByTagName('item') as $node){
					$item = array (
						'barang1' => $node->getElementsByTagName('barang')->item(0)->nodeValue,
						'ket1' => $node->getElementsByTagName('ket')->item(0)->nodeValue,
						'harga1' => $node->getElementsByTagName('harga')->item(0)->nodeValue, 
						'penulis1' => $node->getElementsByTagName('penulis')->item(0)->nodeValue,
						'hal1' => $node->getElementsByTagName('hal')->item(0)->nodeValue,
						'tahun1' => $node->getElementsByTagName('tahun')->item(0)->nodeValue, 
						'gambar1' => $node->getElementsByTagName('gambar')->item(0)->nodeValue, 
						'stok1' => $node->getElementsByTagName('stok')->item(0)->nodeValue,
						'diskon1' => $node->getElementsByTagName('diskon')->item(0)->nodeValue,
						'dijual1' => $node->getElementsByTagName('dijual')->item(0)->nodeValue,
						'dihapus1' => $node->getElementsByTagName('dihapus')->item(0)->nodeValue,
						'tags1' => $node->getElementsByTagName('tags')->item(0)->nodeValue,
					);
				array_push($feed, $item);
				}
//data ditampilkan
			$limit = count($feed);//maksimal data yang mau ditampilkan
?>
<div style="margin-left:20px; margin-top: 30px;">
<h2>Daftar Produk</h2>
</div>
<?php
$username = $this->session->userdata('username');
$id_user = $this->session->userdata('id_user');

/*if(count($produk)){
		foreach($produk as $rows){*/
	for ($x=0; $x<$limit;$x++){
		//foreach ($x as $rows){
	//var_dump($rows);
	
	  ?>
<div class="panel panel-primary" style="margin-right:10px">
  <!-- Default panel contents -->
  <div class="panel-heading">
  </div>
  <div class="panel-body">
   <div class="hero-unit">
		<div class="media">
			<a class="pull-left" href="#">
				<?php
				$gambar2 = $feed[$x]['gambar1'];
				echo '<img src="http://localhost/gambar/'.$gambar2.'">';
				?>
				
			</a>
			<div class="media-body">
				<h4 class="media-heading"><?php echo $barang2 = $feed[$x]['barang1']; ?></h4>
				<?php 
				echo $ket2 = $feed[$x]['ket1']; //str_replace(' & ', '&amp; ', $feed[$x]['title']);
				?>
				</div>
				<p> 
				<?php
				echo 'Harga: Rp ' .$harga2 = $feed[$x]['harga1']; ?>
				</p>
				
		</div>
		
		
		
   </div>
</div>

</div>


<?php
	}


?>